package com.itheima.streamdemo.myStream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class MyStreamDemo04 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(List.of("林青霞", "张曼玉", "王祖贤", "柳岩", "张敏", "张无忌", "张三丰", "张翠山"));

        Stream<String> limitStream = list.stream().limit(6);

        //skip(long l)
        Stream<String> skipStream = list.stream().skip(list.size() - 3);

        //concat(Stream,Stream)
        Stream<String> concatStream = Stream.concat(limitStream, skipStream);

        //distinct();
        Stream<String> distinctStream = list.stream().distinct();

    }
}
